﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Kang.ExtendMethod
{
	public class Idcard
	{
		private string provinceCode;
		private string cityCode;
		private DateTime? birthDate;
		private int gender;
		private int age;

		/// 
		/// 构造
		/// 
		/// @param idcard 身份证号码
		/// 
		public Idcard(string idcard)
		{
			this.provinceCode = idcard.GetProvinceCodeByIdCard();
			this.cityCode = idcard.GetCityCodeByIdCard();
			this.birthDate = idcard.GetBirthDate();
			this.gender = idcard.GetGenderByIdCard();
			this.age = idcard.GetAgeByIdCard();
		}

		/// 
		/// 获取省份代码
		/// 
		/// @return 省份代码
		/// 
		public string getProvinceCode()
		{
			return this.provinceCode;
		}

		/// 
		/// 获取省份名称
		/// 
		/// @return 省份代码
		/// 
		public string GetProvince()
		{
			return this.provinceCode;
		}

		/// 
		/// 获取市级编码
		/// 
		/// @return 市级编码
		/// 
		public string GetCityCode()
		{
			return this.cityCode;
		}

		/// 
		/// 获得生日日期
		/// 
		/// @return 生日日期
		/// 
		public DateTime? GetBirthDate()
		{
			return this.birthDate;
		}

		/// 
		/// 获取性别代号，性别(0 : 男 ， 1 : 女)
		/// 
		/// @return 性别(0 : 男 ， 1 : 女)
		/// 
		public int GetGender()
		{
			return this.gender;
		}

		/// 
		/// 获取年龄
		/// 
		/// @return 年龄
		/// 
		public int GetAge()
		{
			return age;
		}

		public override string ToString()
		{
			return "Idcard{" +
					"provinceCode='" + provinceCode + '\'' +
					", cityCode='" + cityCode + '\'' +
					", birthDate=" + birthDate +
					", gender=" + gender +
					", age=" + age +
					'}';
		}
	}
}
